#include<vector>
#include<algorithm>
#include<unordered_map>
#include<unordered_set>
using namespace std;

class Solution {
public:
    int findRepeatNumber(vector<int>& nums) {
        unordered_map<int, int> map;
        for (int i = 0; i < nums.size(); i++)
        {
            if (map.count(nums[i])){
                map[nums[i]] += 1;
                if (map[nums[i]]>=2)return nums[i];
            }else{
                map[nums[i]]=1;
            }
        }
        return -1;
    }
};